import request from '@/utils/request'
//删除DELETE /admin/product/deleteAttr/{attrId}
export function deleteAttrApi(attrId) {
  return request({
    url: `/admin/product/deleteAttr/${attrId}`,
    method: 'delete',
  })
}

//更新添加 POST /admin/product/saveAttrInfo
export function saveAttrInfoApi(data) {
  return request({
    url: `/admin/product/saveAttrInfo`,
    method: 'post',
    data
  })
}
//属性列表GET /admin/product/attrInfoList/{category1Id}/{category2Id}/{category3Id}
export function getAttrListApi(category1Id,category2Id,category3Id) {
  return request({
    url: `/admin/product/attrInfoList/${category1Id}/${category2Id}/${category3Id}`,
    method: 'get',
  })
}

//获取一级列表GET /admin/product/getCategory1
export function getCategory1ListApi() {
  return request({
    url: `/admin/product/getCategory1`,
    method: 'get',
  })
}
//获取二级列表GET /admin/product/getCategory2/{category1Id}
export function getCategory2ListApi(category1Id) {
  return request({
    url: `/admin/product/getCategory2/${category1Id}`,
    method: 'get',
  })
}
//获取三级列表GET /admin/product/getCategory3/{category2Id}
export function getCategory3ListApi(category2Id) {
  return request({
    url: `/admin/product/getCategory3/${category2Id}`,
    method: 'get',
  })
}
